package com.imooc.action;

import com.opensymphony.xwork2.ActionSupport;
import org.apache.struts2.interceptor.ServletRequestAware;
import org.apache.struts2.interceptor.ServletResponseAware;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

public class HelloWorldAction extends ActionSupport implements ServletRequestAware,ServletResponseAware{

    //helloworld.action

    private HttpServletRequest request;

    public String add(){
        request.setAttribute("path", "update");
        return "add";
    }

    public String update(){
        return "update";
    }

    @Override
    public String execute() throws Exception {
        System.out.println("执行Action");
        return SUCCESS;
    }

    @Override
    public void setServletRequest(HttpServletRequest request) {
        this.request = request;
    }

    @Override
    public void setServletResponse(HttpServletResponse response) {
        
    }
}
